[AUTOMATIONS-CONTRACT] Vesting Scheduler V3#2054
Merged
kasparkallas merged 64 commits intosuperfluid-org:devfrom May 8, 2025
Merged
[AUTOMATIONS-CONTRACT] Vesting Scheduler V3#2054kasparkallas merged 64 commits intosuperfluid-org:devfrom
kasparkallas merged 64 commits intosuperfluid-org:devfrom
Conversation
- Rename `updateVestingSchedule` to `updateVestingScheduleEndDate` - Optimize schedule update mechanism with more precise vesting calculations - Simplify flow rate and remainder amount handling - Update error handling and edge case management
- Add comprehensive test cases for `updateVestingScheduleEndDate` and `updateVestingScheduleAmount` - Improve error handling tests for non-existent vesting schedules - Refactor existing tests to use new method signatures - Optimize test scenarios for end date and amount updates
- Introduce `_settle` method to handle vesting schedule updates and tracking - Remove `totalAmount` from storage and improve vesting calculation logic - Add `lastUpdated` timestamp to track precise vesting progress - Enhance early termination and compensation handling - Commented out unused update methods with TODOs for future implementation
- Update test cases to reflect recent refactoring of vesting schedule mechanisms - Remove commented-out test methods for non-existent schedule updates - Improve settlement calculation by using total amount to vest - Simplify vesting schedule verification in test scenarios
- Adjust settlement calculation to subtract cliff amount from already vested amount - Optimize total vested amount calculation by improving parentheses placement - Refactor `_executeCliffAndFlow` and `executeEndVesting` to handle vesting amounts more precisely
- Update test cases to improve vesting amount and timing calculations - Simplify test setup and execution flow - Enhance precision in settlement and balance verification - Optimize time warping and event expectation in test methods
- Refactor `_getTotalVestedAmount` to enhance clarity and precision of vesting calculations - Correct remainder amount calculation by subtracting flow rate duration from total vested amount - Add comments to clarify vesting logic for different schedule stages - Optimize flow amount calculation with improved variable naming
- Replace hardcoded early end time calculation with bounded randomization - Remove unused total amount to vest calculation - Comment out previous early end time calculation method - Improve test scenario randomness and flexibility
- Restore original early end time calculation using division - Remove bounded randomization approach - Simplify early vesting end time selection logic
…hedule update logic - Add implementation for `updateVestingScheduleFlowRateFromAmount` method - Enhance schedule update validation with comprehensive time window checks - Improve settlement logic in `_settle` method - Optimize flow rate and remainder amount calculations during schedule updates - Add comments to clarify update conditions and vesting logic
…dulerV3 - Implement new events `VestingScheduleTotalAmountUpdated` and `VestingScheduleEndDateUpdated` - Update event emissions to include remainder amount and flow rate details - Rename `updateVestingScheduleEndDate` to `updateVestingScheduleFlowRateFromEndDate` - Enhance event logging with comprehensive schedule update information
… updates - Modify test methods to use `updateVestingScheduleFlowRateFromEndDate` - Enhance calculation of expected remainder and new flow rate - Update test assertions to verify total vested amount and balance transfers - Refactor batch operation encoding to match new method signature
…method - Delete unused and commented-out method from VestingSchedulerV3 - Clean up code by removing deprecated implementation with TODO comments - Simplify contract by eliminating unimplemented method
…dates - Implement test scenarios for updating vesting schedules with longer and shorter durations - Add test cases for updating vesting schedule amounts (both larger and smaller) - Uncomment and update previously commented-out test method for non-existent schedule updates - Enhance test coverage for flow rate and remainder calculations during schedule modifications
added support for batch calls using OPERATION_TYPE_ERC2771_FORWARD_CALL
…hedulerV3 deployment
…n + remove `ctx` from other update functions
…ace and contract - added natspec comments
- allows to cleanly end vesting schedule immediately - added condition not to allow vesting schedule updates when claim period has ended - allowed updating vesting schedule end date to current block timestamp - made executeCliffAndFlow and executeEndVesting public instead of just external
kasparkallas
approved these changes
Apr 24, 2025
Codecov ReportAll modified and coverable lines are covered by tests ✅ 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Vesting Scheduler V3 offers the possibility for vesting sender to update their vesting schedule amounts and/or durations.
Modifications includes :
updateVestingSchedulemethod with dynamic flow rate calculationOptimism Sepolia Deployment :
Contract is deployed at 0x2dCFbF5BcE0522257E78bF164871770D30634A96